// 该页面承接密码和手机登录表单
import React, { Component } from 'react'
// 导入组件
import Passwdlogin from './PasswdLogin';
import MobileLogin from './MobileLogin';
// Tabs文件
import { Tabs } from 'antd';
// 导入css
import "./Index.css";

export default class index extends Component {
  constructor(props){
    super(props)
    // 在这里判断用户是否已经登陆
    let jwt = sessionStorage.getItem("jwt")
    if(jwt){
      this.props.history.push("/dashboard");
    }
  }
  render() {
    const { TabPane } = Tabs;
    return (
      <>
        <div className="container" >
          <Tabs className="tabs" defaultActiveKey="1" centered>
            <TabPane tab="密码登录" key="1">
              <Passwdlogin/>
            </TabPane>
            <TabPane tab="短信登录" key="2">
              <MobileLogin/>
            </TabPane>
          </Tabs>
        </div>
      </>
    )
  }
}
